package com.atguigu.gulimall.ware.service;

import com.atguigu.common.mq.OrderTo;
import com.atguigu.common.mq.StockLockedTo;
import com.atguigu.gulimall.ware.ao.WareSkuLockAo;
import com.atguigu.gulimall.ware.entity.SkuHasStockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author dcj
 * @email dcj@gmail.com
 * @date 2023-10-31 21:16:50
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIdS);

    /**
     * 锁定库存
     * @param ao
     * @return Boolean
     */
    Boolean lockStock(WareSkuLockAo ao);

    /**
     * 解锁库存
     * @param to
     */
    void unlockStock(StockLockedTo to);

    /**
     * 解锁库存 订单
     * @param to
     */
    void unlockStockOrderHandle(OrderTo to);


}

